package es.ats.codington.festival.daos;

import java.util.Properties;

import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;


import es.ats.codington.festival.interfaces.daos.IEventDAOImp;
import es.ats.codington.festival.interfaces.daos.IEventSignUpDAOImp;
import es.ats.codington.festival.interfaces.daos.IPlaceDAOImp;
import es.ats.codington.festival.interfaces.daos.IVisitorDAOImp;


public class ManagerDAOImp{
	
	private DataSource dataSource;
	private Properties queryProperties;
	private JdbcTemplate jdbcTemplate; 
	
	/**
	 * @return the dataSource
	 */
	public DataSource getDataSource() {
		return dataSource;
	}
	/**
	 * @param dataSource the dataSource to set
	 */
	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}
	/**
	 * @return the queryProperties
	 */
	public Properties getQueryProperties() {
		return queryProperties;
	}
	/**
	 * @param queryProperties the queryProperties to set
	 */
	public void setQueryProperties(Properties queryProperties) {
		this.queryProperties = queryProperties;
	}
	/**
	 * @return the jdbcTemplate
	 */
	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}
	/**
	 * @param jdbcTemplate the jdbcTemplate to set
	 */
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	
	/**
	 * Return an instance of IEventDAO
	 * 
	 * @return EventDAO
	 */
	public IEventDAOImp getEventDAO() {		 	
		return new EventDAOImp(jdbcTemplate,queryProperties);				 			
	}	
	
	public IVisitorDAOImp getVisitorDAO() {		 	
		return new VisitorDAOImp(jdbcTemplate,queryProperties);				 			
	}	
	
	public IPlaceDAOImp getPlaceDAO() {		 	
		return new PlaceDAOImp(jdbcTemplate,queryProperties);				 			
	}	
	
	public IEventSignUpDAOImp getEventSignUpDAO() {		 	
		return new EventSignUpDAOImp(jdbcTemplate,queryProperties);				 			
	}	
	
}